/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.dao.hibernate;

import com.click.app.dao.CartDao;
import com.click.app.model.LabelValue;
import com.click.app.model.Cart;
import com.click.app.model.Product;
import com.click.app.model.User;
import java.util.List;

/**
 *
 * @author arnold
 */
public class CartDaoHibernate extends GenericDaoHibernate<Cart, Long> implements CartDao {
    List<LabelValue> cartLabelValueList;
    public CartDaoHibernate() {
        super(Cart.class);
    }


    public List<Cart> findById(Long id) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public List<Cart> findCartByProduct(Product product) {
       List listCarts = getHibernateTemplate().find("from Cart where product=?", product);
       return listCarts;
    }

    public List<Cart> findCartByUser(User user) {
       List listCarts = getHibernateTemplate().find("from Cart where user=?", user);
       return listCarts;
    }


}

